function [r_uncomp]=volt_corr(r_access,compens)

global VOLTAGE CURRENT

%voltage correction
%does the voltage correction
%r_uncomp=(1-%comp)*r_access
%V=V-(I*r_uncomp)
%QueMessage(sprintf('Ra drop voltage correction with Ra=%8.3f', r_access));
if(isempty(r_access))
   r_access = 0;
end;
r_uncomp=(1-compens)*r_access;
if(length(r_uncomp) == 1)
   r_uncomp = ones(size(VOLTAGE,1))*r_uncomp;
end;
for i = 1: size(VOLTAGE, 1)
   VOLTAGE(i,:) = VOLTAGE(i,:) - CURRENT(i,:) * r_uncomp(i);
end;
return
